//
//  SecondCpntentTableviewCell.m
//  HandWork
//
//  Created by 王阳阳 on 16/1/25.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "SecondCpntentTableviewCell.h"

@implementation SecondCpntentTableviewCell
- (void)dealloc
{
    [_titleLabel release];
    [_price release];
    [_buy release];
    [_img release];
    [_contentLabel release];
    [super dealloc];
}
#pragma mark - 初始化
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creat];
    }
    return self;
}
- (void)creat
{
    //图片
    self.img = [[UIImageView alloc]init];
    [self.contentView addSubview:self.img];
    [_img release];
    //标题
    self.titleLabel = [[UILabel alloc]init];
    [self.img addSubview:self.titleLabel];
    [_titleLabel release];
    //内容
    self.contentLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.contentLabel];
    [_contentLabel release];
    //价格
    self.price = [[UILabel alloc]init];
    [self.contentView addSubview:self.price];
    [_price release];
    //购买数量
    self.buy = [[UILabel alloc]init];
    [self.contentView addSubview:self.buy];
    [_buy release];
    
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    /*****图片*****/
    self.img.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200);
    self.img.layer.cornerRadius = 5;
    self.img.clipsToBounds = YES;
    /*****标题*****/
    self.titleLabel.frame = CGRectMake(0, 50, [UIScreen mainScreen].bounds.size.width, 80);
    self.titleLabel.textColor = [UIColor whiteColor];//字体颜色
    self.titleLabel.font = [UIFont systemFontOfSize:14];//字体大小
    self.titleLabel.font = [UIFont boldSystemFontOfSize:16];//字体加粗
    self.titleLabel.textAlignment = NSTextAlignmentCenter;//居中
    self.titleLabel.numberOfLines = 0;//不限制行数
    /****内容*****/
    self.contentLabel.frame = CGRectMake(0, self.img.frame.size.height, [UIScreen mainScreen].bounds.size.width, 60);
    self.contentLabel.font = [UIFont systemFontOfSize:14];//字体
    self.contentLabel.numberOfLines = 0;//不限制行数
    /*****价格*****/
    self.price.frame = CGRectMake(0, self.contentLabel.frame.size.height +self.contentLabel.frame.origin.y, [UIScreen mainScreen].bounds.size.width / 4 , 30);
    self.price.textColor = [UIColor redColor];//字体颜色
    self.price.font = [UIFont systemFontOfSize:24];//字体大小
    /*****购买数量*****/
    self.buy.frame = CGRectMake(self.price.frame.size.width, self.contentLabel.frame.size.height +self.contentLabel.frame.origin.y, [UIScreen mainScreen].bounds.size.width / 3, 30);
    self.buy.font = [UIFont systemFontOfSize:14];//字体大小
    self.buy.textColor = [UIColor grayColor];//字体颜色
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
